﻿/*
* 
* TEST = OK
*/
Library.Array.Add = function(array, arrayObject) {
    array[array.length] = arrayObject;
    return array;
};

/*
* 
* TEST = OK
*/
Library.Array.Remove = function(array, arrayObject) {
    var newArray = new Array();
    var index = 0;
    for (var i = 0; i < array.length; i++) {
        if (i != index) {
            newArray[index] = array[i];
            index++;
        }
    }
    return newArray;
};

/*
* 
* TEST = OK
*/
Library.Array.RemoveByObject = function(array, arrayObject) {
    var newArray = new Array();
    var index = 0;
    for (var i = 0; i < array.length; i++) {
        if (array[i] != arrayObject) {
            newArray[index] = array[i];
            index++;
        }
    }
    return newArray;
};

Library.Array.Contains = function (array, object) {
    for (var i = 0; i < array.length; i++) {
        if (array[i] == object) {
            return true;
        }
    }
    return false;
};